package com.xilihui.xlh.business.activitys;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.webkit.WebView;

import com.xilihui.xlh.R;
import com.xilihui.xlh.constant.UrlConst;
import com.xilihui.xlh.core.app.BaseCompatActivity;

import butterknife.BindView;

/**
 * Created by Administrator on 2018/7/5.
 */

public class WebActivity extends BaseCompatActivity{
    
    @BindView(R.id.webview)
    WebView webView;
    
    int type = 1;
    String url = "";
    
    @Override
    public int getLayout() {
        return R.layout.activity_web;
    }

    @Override
    public String initTitle() {
        return null;
    }

    @Override
    public void initUI(@Nullable Bundle savedInstanceState) {
        
        type = getIntent().getIntExtra("type",0);
        switch (type){
            case 1:
                setTitle("软件使用许可协议");
                url = UrlConst.baseUrl() + "/api/index/news";
                break;
            case 2:
                setTitle("千锐集平台用户规则");
                url = UrlConst.baseUrl() + "api/index/news_ruler";
                break;
            case 3:
                setTitle("规则说明");
                url = UrlConst.baseUrl() + "api/index/news_credit";
                break;
            case 4:
                setTitle("个人信息及隐私保护政策");
                url = UrlConst.baseUrl() + "api/index/news_person";
        }
        
    }

    @Override
    public void initData() {
        webView.loadUrl(url);
    }
    
    
}
